package com.sinosoft.emplmis.collect.web;

import java.util.ArrayList;
import java.util.List;

import org.codehaus.jackson.map.ObjectMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.sinosoft.emplmis.collect.entity.LaborCollectEntity;
import com.sinosoft.emplmis.collect.entity.UnemployedCollectEntity;
import com.sinosoft.emplmis.collect.service.JoblessCollectService;
import com.sinosoft.emplmis.collect.service.LaborCollectService;

/**
 * 汇总统计Controller
 * @author Administrator
 *
 */
@Controller
@RequestMapping("collect/management")
public class CollectManagerController {
	
	ObjectMapper mapper = new ObjectMapper();	
	
	/**
	 * 劳动力就业情况汇总表（全区）页面跳转
	 * @return
	 */
	@RequestMapping(value="/laborCollect_whole", method = RequestMethod.GET)
	public String laborCollect_whole(){
		return "collect/laborCollect";
	}
	
	/**
	 * 劳动力就业情况汇总表（街道）页面跳转
	 * @return
	 */
	@RequestMapping(value="/laborCollect_street", method = RequestMethod.GET)
	public String laborCollect_street(){
		return "collect/laborCollect_street";
	}
	
	@RequestMapping(value="/laborCollect_street_jump", method = RequestMethod.GET)
	public String laborCollect_street_jump(){
		return "collect/laborCollect_street_jump";
	}
	
	/**
	 * 劳动力就业情况汇总表（社区）页面跳转
	 * @return
	 */
	@RequestMapping(value="/laborCollect_community",method = RequestMethod.GET)
	public String laborEmployedCollect_community(){
		return "collect/laborCollect_community";
	}
	
	@RequestMapping(value="/laborCollect_community_jump",method = RequestMethod.GET)
	public String laborEmployedCollect_community_jump(){
		return "collect/laborCollect_community_jump";
	}
	
	/**
	 * 失业人员情况汇总表（全区）页面跳转
	 * @return
	 */
	@RequestMapping(value="/unemployedCollect_whole", method = RequestMethod.GET)
	public String unemployedCollect_whole(){
		return "collect/unemployedCollect";
	}
	
	/**
	 * 失业人员情况汇总表（街道）页面跳转
	 * @return
	 */
	@RequestMapping(value="/unemployedCollect_street", method = RequestMethod.GET)
	public String unemployedCollect_street(){
		return "collect/unemployedCollect_street";
	}
	
	@RequestMapping(value="/unemployedCollect_street_jump", method = RequestMethod.GET)
	public String unemployedCollect_street_jump(){
		return "collect/unemployedCollect_street_jump";
	}
	
	/**
	 * 失业人员情况汇总表（社区）页面跳转
	 * @return
	 */
	@RequestMapping(value="/unemployedCollect_community", method = RequestMethod.GET)
	public String unemployedCollect_community(){
		return "collect/unemployedCollect_community";
	}
	
	@RequestMapping(value="/unemployedCollect_community_jump", method = RequestMethod.GET)
	public String unemployedCollect_community_jump(){
		return "collect/unemployedCollect_community_jump";
	}
	
	
	@Autowired
	private LaborCollectService laborCollectService;	
	
	/**
	 * 获取劳动力全区汇总信息
	 */
	@RequestMapping(value="/getLaborCollectList", method = RequestMethod.POST)
	@ResponseBody
	public List<LaborCollectEntity> getLaborCollectList(){		
		List<LaborCollectEntity> resultList = new ArrayList<LaborCollectEntity>();
		resultList = laborCollectService.getLaborCollectList();
		return resultList;		
	}
	
	/**
	 * 获取劳动力街道汇总信息
	 */
	@RequestMapping(value="/getLaborStreetList", method = RequestMethod.POST)
	@ResponseBody
	public List<LaborCollectEntity> getLaborStreetList(@RequestParam("streetName") String streetName,@RequestParam("streetId") String streetId){
		List<LaborCollectEntity> resultList = new ArrayList<LaborCollectEntity>();
		resultList = laborCollectService.getLaborStreetList(streetName,streetId);
		return resultList;
	}
	
	/**
	 * 获取劳动力社区汇总信息
	 */
	@RequestMapping(value="/getLaborCommunityList", method = RequestMethod.POST)
	@ResponseBody
	public List<LaborCollectEntity> getLaborCommunityList(@RequestParam("communityName") String communityName){
		List<LaborCollectEntity> resultList = new ArrayList<LaborCollectEntity>();
		resultList = laborCollectService.getLaborCommunityList(communityName);
		return resultList;
	}
	
		
	@Autowired
	private JoblessCollectService joblessCollectService;
	
	/**
	 * 获取失业人员全区汇总信息
	 */
	@RequestMapping(value="/getUnemployedCollectList", method = RequestMethod.POST)
	@ResponseBody
	public List<UnemployedCollectEntity> getUnemployedCollectList(){		
		List<UnemployedCollectEntity> resultList = new ArrayList<UnemployedCollectEntity>();
		resultList = joblessCollectService.getJoblessCollectList();
		return resultList;	
	}
	
	/**
	 * 获取失业人员街道汇总信息
	 */
	@RequestMapping(value="/getUnemployedStreetList", method = RequestMethod.POST)
	@ResponseBody
	public List<UnemployedCollectEntity> getUnemployedStreetList(@RequestParam("streetName") String streetName,@RequestParam("streetId")String streetId){		
		List<UnemployedCollectEntity> resultList = new ArrayList<UnemployedCollectEntity>();
		resultList = joblessCollectService.getJoblessStreetList(streetName,streetId);
		return resultList;	
	}
	
	/**
	 * 获取失业人员社区汇总信息
	 */
	@RequestMapping(value="/getUnemployedCommunityList", method = RequestMethod.POST)
	@ResponseBody
	public List<UnemployedCollectEntity> getUnemployedCommunityList(@RequestParam("communityName") String communityName){		
		List<UnemployedCollectEntity> resultList = new ArrayList<UnemployedCollectEntity>();
		resultList = joblessCollectService.getJoblessCommunityList(communityName);
		return resultList;	
	}
	
}
